package com.zxy.ziems.server.device.pojo.dto;


import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

/**
 * 通信通道管理
 * @author 10348359
 * @create 2024-03-25 11:30
 */
@Data
public class ChannelDTO {
    /**
     * 主键
     */
    @Null(message = "ID必须为空", groups = {Add.class})
    @NotBlank(message = "ID不能为空", groups = {Delete.class, Update.class})
    private String id;

    /**
     * 通道名称
     */
    @NotBlank(message = "通道名称不能为空", groups = {Add.class, Update.class})
    private String name;

    /**
     * ip 地址
     */
    @NotBlank(message = "IP地址不能为空", groups = {Add.class, Update.class})
    private String ip;

    /**
     * 端口
     */
    @NotNull(message = "端口不能为空", groups = {Add.class, Update.class})
    private Integer port;

    /**
     * 集采地址
     */
    @NotBlank(message = "采集器不能为空", groups = {Add.class, Update.class})
    private String collectorId;

    /**
     * 协议
     */
    @NotBlank(message = "协议不能为空", groups = {Add.class, Update.class})
    private String protocolId;

    /**
     * 设备类型编码
     */
    @NotBlank(message = "设备类型不能为空", groups = {Add.class, Update.class})
    private String deviceTypeCode;


    public interface Add{}
    public interface Update{}
    public interface Delete {}
}
